<?php
class parser extends parent_class
	{
		public $items=array();
		
		public function additem($name,$value="")
		{
			if (trim($name)=="")
			{
				return false;
			}
			$this->items[$name]=$value;
		}
		
		public function reset()
		{
			$this->items=array();
		}
		
		public function parse($str="")
		{
			if (!$this->items)
			{
				return false;
			}
			
			foreach($this->items as $key => $item)
			{
				$str=str_replace($key,$item,$str);
			}
			return $str;
		}
	}
?>